#include "ISet.h"
#include "tests.h"
#include "ISet.cpp"
#include "tests.cpp"
#include <iostream>
#include <algorithm>
#include <unordered_set>
#include <iterator>


std::unique_ptr<ISet> intersection(const ISet& first, const ISet& second)
{
	std::vector<int> result;
	first.foreach([&second, &result] (int value) {
		if (second.contains((value))) {
			result.push_back(value);
		}
	});
	return makeCompactSet(result);
}


int main()
{
	/*
	const auto set = intersection(
		*makeCompactSet({1, 2, 3, 100500}),
		*makeCompactSet({2, 1024, -100, 100500}));
	set->foreach([] (int value) { std::cout << value << ", "; });
	std::cout << std::endl;
	std::cout << "byte size = " << set->byteSize() << std::endl;
	*/
	testISet();
	return 0;
}
